package service

import (
	"github.com/jinzhu/gorm"
	"tylnmall/models"
)

func IsUser(db *gorm.DB, id int)(bool,models.User){
	var err error
	var user models.User
	if err=db.Where("id = ?",id).Find(&user).Error;err!=nil{
		return false,user
	}
	return true,user
}